package cn.mianshiyi.example;


import cn.mianshiyi.braumclient.annotation.EnableEasyRateLimiter;
import cn.mianshiyi.braumdatasource.apollo.ApolloDataSource;
import cn.mianshiyi.braumdatasource.nacos.NacosDataSource;
import com.alibaba.nacos.api.config.ConfigType;
import com.alibaba.nacos.api.config.annotation.NacosConfigurationProperties;
import com.alibaba.nacos.api.config.annotation.NacosProperty;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication(scanBasePackages = "cn.mianshiyi.example")
@EnableEasyRateLimiter
public class ExampleApplication {

    public static void main(String[] args) {
        SpringApplication.run(ExampleApplication.class, args);
        try {
            //采用外部动态配置规则方式
            //new NacosDataSource("BRAUM", "cn.mianshiyi.braum.nacos.datasource", "localhost:8848");
            //new ApolloDataSource("braum-test", "application", "braum.limit.rule", "http://localhost:8080");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
